package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-10-23 9:50
 */
public class Test03 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入总金额");
        double total=scanner.nextDouble();
        System.out.println("输入是否是会员y/n");
        String answer=scanner.next();
        double rate=1,pay;
        if("y".equals(answer)){
            //会员折扣
            if(total>=100){
                rate=0.7;
            }else{
                rate=0.8;
            }
        }else{
            //非会员折扣
            if(total>=300){
                rate=0.9;
            }
//            else{
//                rate=1;
//            }
        }

        //计算总价，输出结果
        pay=total*rate;
        System.out.println("总价："+total+",折扣:"+rate+",应付金额:"+pay);
    }
}
